package com.junmo.common.exception;

import com.junmo.common.result.IResultCode;
import lombok.Data;

/**
 * @author zjj
 * @date 2021/10/29 15:53
 * @description
 */
@Data
public class RemindException extends RuntimeException {

    private static final String REMIND = "操作异常";

    private static final long serialVersionUID = 1L;

    /**
     * 提醒编码
     */
    private String code;

    /**
     * 提醒消息内容
     */
    private String defaultMessage;

    public RemindException(String code, String defaultMessage) {
        this.code = code;
        this.defaultMessage = defaultMessage;
    }

    public RemindException(String defaultMessage) {
        this.code = "600";
        this.defaultMessage = defaultMessage;
    }

    public RemindException(IResultCode resultCode) {
        this.code = resultCode.getCode();
        this.defaultMessage = resultCode.getMsg();
    }
}
